home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
program
/
385
/
prg_1
/
prg_1cp.s
< prev
next >
Wrap
Text File
|
1985-11-19
|
3KB
|
58 lines
; Program Name: PRG_1CP.S
; Version: 1.002
; Assembly Instructions:
; Assemble in AssemPro PC-relative mode and save the assembled program
; with PRG and TOS extensions.
; Program Function:
; Prints a string to the video screen. If the program is executed
; within the AssemPro debugger, the string should overwrite the debugger
; screen, even if the AssemPro "Save Screen" option has been selected. To
; verify this phenomenon, power the computer down, then back up. Execute
; ASSEMPRO.PRG, then load or type this program into the editor. Assemble,
; then activate the debugger. Select "Save Screen" and "symbolic". Finally,
; select "Run Program". The debugger screen will be overwritten in an
; unpredictable area.
; Watch the debugger screen carefully, during execution, so that you
; will be able to see the writeover occur.
; Depending on the location of the overwritten area, AssemPro may
; redraw a portion of its screen after the event.
; The overwrite is likely to occur only once, the first time a program
; which writes to the screen is executed within the debugger.
; After the string has been written, the program waits until a key
; is pressed on the keyboard. When that event occurs, it returns control
; to the debugger.
; Note - We have not defined a program stack. We are using the default
; system stack located at $4DB8, according to Internals page 276.
print_string:
pea string ; Push address of the string onto stack.
move.w #9, -(sp) ; Function = c_conws = GEMDOS $9.
trap #1 ; GEMDOS call
addq.l #6, sp ; Reset stack pointer to top of stack.
wait_for_keypress:
move.w #8, -(sp) ; Function = c_necin = GEMDOS $8.
trap #1 ; GEMDOS call.
addq.l #2, sp ; Reposition stack pointer at top of stack.
terminate: ; My descriptive label.
move.w #0, -(sp) ; Function = p_term_old = GEMDOS $0.
trap #1 ; GEMDOS call.
string: dc.b 'This string will overwrite the AssemPro debugger screen.'
dc.b $D,$A,0 ; The string is continued on this line. Here, we
; declare a carriage return and linefeed, then
; terminate the entire string with a NULL = 0.
end ; Assembler pseudo-op.